package kr.memo.validator;

import org.springframework.validation.Errors;
import org.springframework.validation.ValidationUtils;
import org.springframework.validation.Validator;

public class MemoValidator implements Validator{

	@Override
	public boolean supports(Class<?> clzz) {
		return false;
	}

	@Override
	public void validate(Object target, Errors errors) {
		ValidationUtils.rejectIfEmptyOrWhitespace(errors, "memo_id", "required");
		ValidationUtils.rejectIfEmptyOrWhitespace(errors, "memo_content", "required");
		ValidationUtils.rejectIfEmptyOrWhitespace(errors, "p_num", "required");
	}

}
